package com.smartcommunity.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import com.google.common.util.concurrent.ThreadFactoryBuilder;

/**
*
* Created on 2019年01月15日 下午2:06:15
* <p>Description: [线程池管理]</p>
* @author [xjx]
* @version 1.0
*/
public class ExecutorUtil {

   public static final ExecutorService executorService;

   static {
       ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("fullSearch-pool-%d").build();
       executorService = new ThreadPoolExecutor(8, 8, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>(), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
   }
}
